import request from '@/utils/request'

export function selectArticle(recommendArticleId) {
  console.log(recommendArticleId);
  
  return request({
    url: '/publish/recommendArticle/get',  
    method: 'get',
    params: { recommendArticleId }  
  });
}
export function addRecommendArticle(data) {
  return request({
    url: '/publish/recommendArticle/add',
    method: 'post',
    data: data
  })

}
export function deleteRecommendArticle(recommendArticleId) {
  return request({
    url: `/publish/recommendArticle/${recommendArticleId}`,
    method: 'delete'
  })
}

export function editRecommentArticle(data) {
  return request({
    url: '/publish/recommendArticle/edit', 
    method: 'put',
    data: data
  });
}
export function selectAllArticles(p) {
  return request({
    url: '/publish/recommendArticle/listAll', 
    method: 'get',
    params:p


  });
}

// 查询文章 
export function getPost(articleId) {
  return request({
    url: '/publish/article/' + articleId,
    method: 'get'
  })
}